<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Visual Admin Dashboard - Home</title>
<meta name="description" content="">
<meta name="author" content="templatemo">
<!-- 
    Visual Admin Template
    https://templatemo.com/tm-455-visual-admin
    -->
<link
	href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,700'
	rel='stylesheet' type='text/css'>
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/templatemo-style.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
<script src="js/jquery-1.11.2.min.js"></script>
<!-- jQuery -->
<script src="js/jquery-migrate-1.2.1.min.js"></script>
<!--  jQuery Migrate Plugin -->
<!--  <script src="https://www.google.com/jsapi"></script>Google Chart -->
<script type="text/javascript" src="js/templatemo-script.js"></script>
<!-- Templatemo Script -->
<script src="js/jquery.cookie.js"></script>


</head>
<body>
	<!-- Left column -->
	<div class="templatemo-flex-row">
		<div class="templatemo-sidebar">
			<header class="templatemo-site-header">
				<div class="square"></div>
				<h1>Visual Admin</h1>
			</header>
			<div class="profile-photo-container">
				<img src="images/profile-photo.jpg" alt="Profile Photo"
					class="img-responsive">
				<div class="profile-photo-overlay"></div>
			</div>
			<!-- Search box -->
			<!--<form class="templatemo-search-form" role="search">
				<div class="input-group">
					<button type="submit" class="fa fa-search"></button>
					<input type="text" class="form-control" placeholder="Search"
						name="srch-term" id="srch-term">
				</div>
			</form>-->
			<div class="mobile-menu-icon">
				<i class="fa fa-bars"></i>
			</div>
			<nav class="templatemo-left-nav">
				<ul>
					<li><a href="index.html"><i class="fa fa-home fa-fw"></i>主页</a></li>
					<li><a href="Memorize_words.html" class="active"><i
							class="fa fa-bar-chart fa-fw"></i>背单词</a></li>
					<li><a href="Ranking.html"><i class="fa fa-database fa-fw"></i>排行榜</a></li>
					<li><a href="words.html"><i class="fa fa-map-marker fa-fw"></i>words</a></li>
					<li><a href="records.html"><i class="fa fa-users fa-fw"></i>单词记录</a></li>
					<li><a href="Test.html"><i
							class="fa 	fa fa-align-justify fa-fw"></i>单词复习</a></li>
					<li><a href="myinfo.html"><i class="fa fa-bar-chart fa-fw"></i>个人信息</a></li>
					<li><a href="setting.html"><i class="fa fa-sliders fa-fw"></i>设置</a></li>
					<li><a href="../login&regist.html"><i
							class="fa fa-eject fa-fw"></i>注销</a></li>
				</ul>
			</nav>
		</div>
		<!-- Main content -->
		<div class="templatemo-content col-1 light-gray-bg">

			<div class="templatemo-content-container">

				<div class="templatemo-flex-row flex-content-row">

					<div class="col-1 vertical  bot">
						<div class="templatemo-content-widget orange-bg word">
							<i class="fa sydc" id="sydc">剩余单词:30</i>
							<div class="fa fa-pre" id="rem">记住了</div>
							<div class="fa fa-nex" id="nex">下一个</div>
							<div class="fa fa-pass" id="pass">pass</div>

							<div class="media wordtop" id="words">
								<div class="media-body">
									<h2 class="media-heading ">等待加载...</h2>
									<p>
										等待加载...</br> 等待加载...</br> 等待加载...</br> 等待加载...</br> 等待加载...</br> 等待加载...</br> 等待加载...</br>
									</p>
								</div>
							</div>
						</div>

					</div>

				</div>
				<!-- Second row ends -->





				<div class="templatemo-content-widget white-bg " id="pl">

					<div class="media">
						<div class="media-body">
							<h2 class="media-heading ">请留下你的评论！！！</h2>



							<select class="form-control mxlk">
								<option value="0" id="xlk">请选择评论类型</option>
								<option value="collocation" id="xlk1">固定搭配</option>
								<option value="example" id="xlk2">例句</option>
								<option value="evaluate" id="xlk3">随笔</option>
							</select>

							<textarea class="texta" id=plwbk> </textarea>

							<div class="form-group text-right loc">
								<button type="submit" class="templatemo-blue-button " id="tjzpl">提交</button>
								<button type="reset" class="templatemo-blue-button " id="qxzpl">取消</button>
							</div>

						</div>
					</div>
				</div>





				<div class="templatemo-content-widget green-bg " id="plb">

					<div class="templatemo-content-widget white-bg ">
						<i class="fa fa-thumbs-o-down" id="czpl">30</i> <i
							class="fa fa-thumbs-o-up" id="dzzpl">30</i>
						<div class="media">
							<div class="media-body">
								<h2 class="media-heading ">等待加载...</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>
						<div class="form-group text-right lright">
							<button type="submit" class="templatemo-blue-button " id="zpl2"
								plk="yc">评论</button>
							<button type="reset" class="templatemo-blue-button " id="qxzpl2">取消</button>
						</div>



						<div typ="yck"
							class="templatemo-content-widget white-bg zplplkhidden" id="yc">

							<div class="media">
								<div class="media-body">
									<h2 class="media-heading ">请留下你的评论！！！</h2>

									<select class="form-control mxlk">
										<option value="html" id="ziplxlk">请选择评论类型</option>
										<option value="plain" id="ziplxlk1"></option>
										<option value="plain" id="ziplxlk2"></option>
										<option value="plain" id="ziplxlk3"></option>
										<option value="plain" id="ziplxlk4"></option>
									</select>

									<textarea class="texta" id=ziplwbk> </textarea>

									<div class="form-group text-right loc">
										<button type="submit" class="templatemo-blue-button "
											id="tjzipl">提交</button>
										<button type="reset" class="templatemo-blue-button "
											id="qxzipl2">取消</button>
									</div>

								</div>
							</div>
						</div>
						<div class="media zpl">
							<div class="media-body">
								<h2 class="media-heading ">子评论</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>




					</div>









					<div class="templatemo-content-widget white-bg ">
						<i class="fa fa-thumbs-o-down" id="czpl">30</i> <i
							class="fa fa-thumbs-o-up" id="dzzpl">30</i>
						<div class="media">
							<div class="media-body">
								<h2 class="media-heading ">等待加载...</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>
						<div class="form-group text-right lright">
							<button type="submit" class="templatemo-blue-button " id="zpl2"
								plk="yc666">评论</button>
							<button type="reset" class="templatemo-blue-button " id="qxzpl2">取消</button>
						</div>



						<div typ="yck"
							class="templatemo-content-widget white-bg zplplkhidden"
							id="yc666">

							<div class="media">
								<div class="media-body">
									<h2 class="media-heading ">请留下你的评论！！！</h2>

									<select class="form-control mxlk">
										<option value="html" id="ziplxlk">请选择评论类型</option>
										<option value="plain" id="ziplxlk1"></option>
										<option value="plain" id="ziplxlk2"></option>
										<option value="plain" id="ziplxlk3"></option>
										<option value="plain" id="ziplxlk4"></option>
									</select>

									<textarea class="texta" id=ziplwbk> </textarea>

									<div class="form-group text-right loc">
										<button type="submit" class="templatemo-blue-button "
											id="tjzipl">提交</button>
										<button type="reset" class="templatemo-blue-button "
											id="qxzipl2">取消</button>
									</div>

								</div>
							</div>
						</div>
						<div class="media zpl">
							<div class="media-body">
								<h2 class="media-heading ">子评论</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>




					</div>






					<div class="templatemo-content-widget white-bg ">
						<i class="fa fa-thumbs-o-down">30</i> <i class="fa fa-thumbs-o-up">30</i>
						<div class="media">
							<div class="media-body">
								<h2 class="media-heading ">等待加载...</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>
						<div class="media zpl">
							<div class="media-body">
								<h2 class="media-heading ">子评论</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>
					</div>



					<div class="templatemo-content-widget white-bg ">
						<i class="fa fa-thumbs-o-down">30</i> <i class="fa fa-thumbs-o-up">30</i>
						<div class="media">
							<div class="media-body">
								<h2 class="media-heading ">等待加载...</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>


						<div class="media zpl">
							<div class="media-body">
								<h2 class="media-heading ">子评论</h2>
								<p>
									等待加载...</br> 等待加载...</br>
								</p>
							</div>
						</div>


					</div>



				</div>




			</div>
		</div>
	</div>

	<!-- JS -->

</body>
</html>
<script>
	
	
	
	var words;
    var index=0;
	var mp= new Map();
	var mpc= new Map();
	if(typeof($.cookie("email"))  == "undefined"){
    		 alert("请先登录");
    		 window.location.href="../login&regist.html";
    	}

	var comment;


	var set;
	var wordstyle;

	    	$.ajax({
    		type:"get",
    		url:"../getmywords",
    		async:false,
    		success:function(res){
    			
    			 words = JSON.parse(res);
    			 var wordshtml = "";
//  			 delete words[0];
//  			 words.splice(0,1);
    			if(words==null||words.length==0){
 						  $("#sydc")[0].innerHTML="";
							 $("#words").html("今天任务已完成,休息一下吧!!!");
    				   return ;
    			}
    			
    			wordshtml = wordshtml + "<div class=\"media-body\"  word = "+words[0]+">";
    			
  	  		    wordshtml = wordshtml + "<h2 class=\"media-heading \">"+words[0]["word"]+"</h2>";
  	  		    if(wordstyle!=""){
   					   wordshtml += "<div class=\"fa fa-fy\" id=\"fy\" toid=\""+words[index]["id"]+"\"  >显示翻译</div>";
   				}
 				wordshtml = wordshtml + "<div class=\"fy\" style = \""+wordstyle+"\"  id=\""+words[index]["id"]+"\">";
    			wordshtml = wordshtml + "<p wd='wd' >  音标    : </br> "+words[0]["accent"]+"</p>";
    			wordshtml = wordshtml + "<p wd='wd' >  词根    : </br> "+words[0]["word_etyma"]+"</p>";
    			wordshtml = wordshtml + "<p wd='wd' >中文翻译  : </br> "+words[0]["mean_cn"]+"</p>";
    			wordshtml = wordshtml + "<p wd='wd' >英文翻译  : </br> "+words[0]["mean_en"]+"</p>";
    			wordshtml = wordshtml + "<p wd='wd' > 例句       : </br> "+words[0]["sentence"]+"</p>";
   	 		    wordshtml = wordshtml + "<p wd='wd' >例句翻译  : </br> "+words[0]["sentence_trans"]+"</p>";
   	 		    wordshtml = wordshtml + "</div>";
    			wordshtml = wordshtml + "</div>";
    			 			
    			 $("#words").html(wordshtml);
    			 
    			 $("#sydc")[0].innerHTML="剩余单词:"+words.length
    			 $("div[id='fy']").click(function(){
    			 	$(this).css("display","none");
					$("#"+$(this).attr("toid")).css("display","");
				})

				
				
				
				
				
			
function del(){
	words.splice(words.indexOf(words[index]),1);
	index=(index+1)%words.length;
}

$("#nex").click(function(){

	 index=(index+1)%words.length;
	 var wordshtml="";
   wordshtml = wordshtml + "<div class=\"media-body\"  word = "+words[index]+">";
   
   wordshtml = wordshtml + "<h2 class=\"media-heading \">"+words[index]["word"]+"</h2>";
   if(wordstyle!=""){
   	   wordshtml += "<div class=\"fa fa-fy\" id=\"fy\" toid=\""+words[index]["id"]+"\"  >显示翻译</div>";
   }
   wordshtml = wordshtml + "<div class=\"fy\" style = \""+wordstyle+"\"  id=\""+words[index]["id"]+"\">";

   wordshtml = wordshtml + "<p>  音标    : </br> "+words[index]["accent"]+"</p>";
   wordshtml = wordshtml + "<p>  词根    : </br> "+words[index]["word_etyma"]+"</p>";
   wordshtml = wordshtml + "<p>中文翻译  : </br> "+words[index]["mean_cn"]+"</p>";
   wordshtml = wordshtml + "<p>英文翻译  : </br> "+words[index]["mean_en"]+"</p>";
   wordshtml = wordshtml + "<p> 例句       : </br> "+words[index]["sentence"]+"</p>";
   wordshtml = wordshtml + "<p>例句翻译  : </br> "+words[index]["sentence_trans"]+"</p>";
    wordshtml = wordshtml + "</div>";
   wordshtml = wordshtml + "</div>";
   
   refresh();			 			
   
   $("#words").html(wordshtml);
   	 $("div[id='fy']").click(function(){
    	$(this).css("display","none");
		$("#"+$(this).attr("toid")).css("display","");
   	 })
});

$("#rem").click(function(){
if(words.length==0){
	 $("#sydc")[0].innerHTML="";
		 $("#words").html("今天任务已完成,休息一下吧!!!");
	}else{
		
	 $.ajax({
	 	type:"post",
	 	url:"../addrecord",
	 	async:true,
	 	data:"type=1&wordid="+words[index]["id"]
	 });
	 
	 del();
	 
	 if(words.length==0){
	 	 $("#sydc")[0].innerHTML="";
			 $("#words").html("今天任务已完成,休息一下吧!!!");
			 return ;
	 }
	  $("#sydc")[0].innerHTML="剩余单词:"+words.length;
	 
	 index=(index+1)%words.length;
	 var wordshtml="";
   wordshtml = wordshtml + "<div class=\"media-body\"  word = "+words[index]+">";
   wordshtml = wordshtml + "<h2 class=\"media-heading \">"+words[index]["word"]+"</h2>";
   if(wordstyle!=""){
   	   wordshtml += "<div class=\"fa fa-fy\" id=\"fy\" toid=\""+words[index]["id"]+"\"  >显示翻译</div>";
   }
   wordshtml = wordshtml + "<div class=\"fy\" style = \""+wordstyle+"\"  id=\""+words[index]["id"]+"\">";
   
   wordshtml = wordshtml + "<p>  音标    : </br> "+words[index]["accent"]+"</p>";
   wordshtml = wordshtml + "<p>  词根    : </br> "+words[index]["word_etyma"]+"</p>";
   wordshtml = wordshtml + "<p>中文翻译  : </br> "+words[index]["mean_cn"]+"</p>";
   wordshtml = wordshtml + "<p>英文翻译  : </br> "+words[index]["mean_en"]+"</p>";
   wordshtml = wordshtml + "<p> 例句       : </br> "+words[index]["sentence"]+"</p>";
   wordshtml = wordshtml + "<p>例句翻译  : </br> "+words[index]["sentence_trans"]+"</p>";
   wordshtml = wordshtml + "</div>";
    wordshtml = wordshtml + "</div>";
   $("#words").html(wordshtml);
   $("div[id='fy']").click(function(){
    			 	$(this).css("display","none");
					$("#"+$(this).attr("toid")).css("display","");
	});
	 
   refresh();			 			
   
   
 }
	
});


$("#pass").click(function(){
	if(words.length==0){
		 $("#sydc")[0].innerHTML="";
     $("#words").html("今天任务已完成,休息一下吧!!!");
	}else{
		$.ajax({
	 	type:"post",
	 	url:"../addrecord",
	 	async:true,
	 	data:"type=2&wordid="+words[index]["id"]
	 });
		del();
		if(words.length==0){
			 $("#sydc")[0].innerHTML="";
			 $("#words").html("今天任务已完成,休息一下吧!!!");
			 return ;
	 }
		$("#sydc")[0].innerHTML="剩余单词:"+words.length;
	 index=(index+1)%words.length;
	 var wordshtml="";
	
   wordshtml = wordshtml + "<div class=\"media-body\"  word = "+words[index]+">";
   wordshtml = wordshtml + "<h2 class=\"media-heading \">"+words[index]["word"]+"</h2>";
   if(wordstyle!=""){
   	   wordshtml += "<div class=\"fa fa-fy\" id=\"fy\" toid=\""+words[index]["id"]+"\"  >显示翻译</div>";
   }
   wordshtml = wordshtml + "<div class=\"fy\" style = \""+wordstyle+"\"  id=\""+words[index]["id"]+"\">";

   wordshtml = wordshtml + "<p>  音标    : </br> "+words[index]["accent"]+"</p>";
   wordshtml = wordshtml + "<p>  词根    : </br> "+words[index]["word_etyma"]+"</p>";
   wordshtml = wordshtml + "<p>中文翻译  : </br> "+words[index]["mean_cn"]+"</p>";
   wordshtml = wordshtml + "<p>英文翻译  : </br> "+words[index]["mean_en"]+"</p>";
   wordshtml = wordshtml + "<p> 例句       : </br> "+words[index]["sentence"]+"</p>";
   wordshtml = wordshtml + "<p>例句翻译  : </br> "+words[index]["sentence_trans"]+"</p>";
   wordshtml = wordshtml + "</div>";
    wordshtml = wordshtml + "</div>";
   $("#words").html(wordshtml);
   
	}
$("div[id='fy']").click(function(){
    			 	$(this).css("display","none");
					$("#"+$(this).attr("toid")).css("display","");
	});
	 
   refresh();			 			
   
   
 });
				



    		}
    	});
	
	
	
	
	
	
	
	
	
	

	$.ajax({
		type:"get",
		url:"../getset",
		async:false,
		success: function(res){
			 set = JSON.parse(res);
			 if(set["istranslate"]==0){
			 	wordstyle = "display:none";
			 }else{
			 	wordstyle = "";
			 }
		}
	});
	
	
	
	
	
	
	
function refresh(){
	if(words==undefined||words.length==0||words==null){
		 $("#plb").html("");
		 $("#pl").css("display","none");
	}
  $.ajax({
    		type:"get",
    		url:"../getcomment",
    		async:false,
    		data:"wordname="+words[index]["word"]+"&wordid="+words[index]["id"],
    		success:function(res){
    			
    			 comment = JSON.parse(res);
    			 console.log(comment);
    			 var allhtml="";
    			 for(var i=0;i<comment.length;i++){
    			 			var easy="";
    						if(comment[i].left.collocation != undefined){
    								easy = easy +comment[i].left.collocation;
    							}
       					 if(comment[i].left.example != undefined){
        							easy = easy +comment[i].left.example;
        					}
        					if(comment[i].left.evaluate != undefined){
        							easy = easy +comment[i].left.evaluate;
        						}

        
    			 	
    			 		
    			 			
    			 	
    			 		   console.log(comment[i].left);
    			 		   allhtml = allhtml+"<div class=\"templatemo-content-widget white-bg \">\r\n" +
"                 <i class=\"fa fa-thumbs-o-down\"id=\"czpl\" commentid = \""+comment[i].left.commentid+"\">"+comment[i].left.thumbs +"</i>\r\n" + 
"                 <i class=\"fa fa-thumbs-o-up\"id=\"dzzpl\" commentid = \""+comment[i].left.commentid+"\">"+comment[i].left.unthumbs +"</i>\r\n" + 
"                <div class=\"media\">\r\n" + 
"                  <div class=\"media-body\">\r\n" + 
"                    <h2 class=\"media-heading \">"+comment[i].left.email+"</h2>\r\n" + 
"                    <p>\r\n" + 
                    easy + 

"                    </p>\r\n" + 
"                  </div>        \r\n" + 
"                </div>     \r\n" + 
"								<div class=\"form-group text-right lright\">\r\n" + 
"               				 <button type=\"submit\" class=\"templatemo-blue-button \" id=\"zpl2\" commentid = \""+comment[i].left.commentid+"\">评论</button>\r\n" + 
"               				 <button type=\"reset\" class=\"templatemo-blue-button \"id=\"qxzpl2\">取消</button>\r\n" + 
"              	</div>\r\n" + 
"                \r\n" + 
"                \r\n" + 
"                \r\n" + 
"                <div typ=\"yck\" class=\"templatemo-content-widget white-bg zplplkhidden\" commentid = \""+comment[i].left.commentid+"\">\r\n" + 
"                 \r\n" + 
"                <div class=\"media\">\r\n" + 
"                  <div class=\"media-body\">\r\n" + 
"                    <h2 class=\"media-heading \">请留下你的评论！！！</h2>\r\n" + 
"                    \r\n" + 

"                    																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																				\r\n" + 
"                    <textarea class=\"texta\" id = \""+comment[i].left.commentid+"\"> </textarea>\r\n" + 
"                    \r\n" + 
"                    <div class=\"form-group text-right loc\">\r\n" + 
"               				 <button type=\"submit\" class=\"templatemo-blue-button \"id=\"tjzipl\" commentid = \""+comment[i].left.commentid+"\">提交</button>\r\n" + 
"               				 <button type=\"reset\" class=\"templatemo-blue-button \"id=\"qxzipl2\"  >取消</button>\r\n" + 
"              			</div>\r\n" + 
"              			\r\n" + 
"                  </div>        \r\n" + 
"                </div>     \r\n" + 
"            </div>\r\n";


    			 		 console.log(comment[i].left);
    			 		for(var j=0;j<comment[i].right.length;j++){
    			 			 
    			 			 allhtml = allhtml+"               <div class=\"media zpl\">\r\n" + 
"                  <div class=\"media-body\">\r\n" + 
"                    <h2 class=\"media-heading \">"+comment[i].right[j].email+"</h2>\r\n" + 
"                    <p>\r\n" + 
                              comment[i].right[j].contant        + 

"                    </p>\r\n" + 
"                  </div>        \r\n" + 
"                </div>  \r\n" ;
    			 		}
    			 		allhtml = allhtml+"              </div>";
    			 	  
    			 }
    			 
    			 
    			 $("#plb").html(allhtml);



	
		$("button[id='zpl2']").click(function(){
			    $("div[typ='yck']").removeClass("zplplk").addClass("zplplkhidden");

			  	console.log(this);
			  	console.log($(this).attr("commentid"));
			  	
			  	$("div[commentid='"+$(this).attr("commentid")+"']").removeClass("zplplkhidden").addClass("zplplk");
					
		});
		
		$("button[type='reset']").click(function(){
			   $("div[typ='yck']").removeClass("zplplk").addClass("zplplkhidden");
					
		});
		

	  
	  $("button[id='tjzipl']").click(function(){
	  	  console.log($(this).attr("commentid"));
	  	  console.log(document.getElementById($(this).attr("commentid")).value);
	  	  console.log(words[index]);
	  	  $.ajax({
	 					type:"post",
	 					url:"../addzremark",
	 					async:true,
	 					data:"content="+document.getElementById($(this).attr("commentid")).value+"&wordid="+words[index]["id"]+"&commentid="+$(this).attr("commentid")+"&wordname="+words[index]["word"]
			 });
			 refresh();
	  	  
	  });


    			 //主评论类型下拉框
$("#xlk");
//主评论类型下拉框第1个选项
$("#xlk1");
//主评论类型下拉框第2个选项
$("#xlk2");
//主评论类型下拉框第3个选项
$("#xlk3");
//评论文本框
$("#plwbk");

//取消主评论
$("#qxzpl");


//子评论按钮
$("#zpl2");
//取消子评论1
$("#qxzpl2");
//踩子评论
$("i[id='czpl']").click(function(){
	console.log(this);
	console.log($(this).attr("commentid"));
	if(mp[$(this).attr("commentid")]==undefined){
		this.innerHTML++;
		$.ajax({
		 	type:"post",
		 	url:"../addthumbs",
		 	async:true,
	 		data:"commentid="+$(this).attr("commentid")
	 	});
	  mp[$(this).attr("commentid")]=1;
	}else{
		alert("已经踩过了哦！！！");
	}

	
	
	
})
//点赞子评论
$("i[id='dzzpl']").click(function(){
	console.log(this);
	console.log($(this).attr("commentid"));
	if(mpc[$(this).attr("commentid")]==undefined){
			this.innerHTML++;
			$.ajax({
			 	type:"post",
	 			url:"../addunthumbs",
	 			async:true,
			 	data:"commentid="+$(this).attr("commentid")
	 		});
	 		mpc[$(this).attr("commentid")]=1;
	}else{
		 alert("已经点过赞了哦！！！");
	}
	
})
//子评论类型下拉框
$("#ziplxlk");
//子评论类型下拉框第1个选项
$("#ziplxlk1");
//子评论类型下拉框第2个选项
$("#ziplxlk2");
//子评论类型下拉框第3个选项
$("#ziplxlk3");
//子评论类型下拉框第4个选项
$("#ziplxlk4");
//子评论文本框
$("#ziplwbk");
//提交子评论
$("#tjzipl");
//取消子评论2
$("#qxzipl2");


 
 }
});

	
};

refresh();

document.getElementById("tjzpl").addEventListener('click',function(){
			var type = "";
	for(var i = 0;i<$("option").length;i++) {   
		if ($("option")[i].selected==true)
		     type=$("option")[i].value;
	};
	
	console.log(type);
	console.log(document.getElementById('plwbk').value);
	
	$.ajax({
	 	type:"post",
	 	url:"../addcomment",
	 	async:false,
	 	data:"content="+document.getElementById('plwbk').value+"&type="+type+"&wordname="+words[index]["word"]+"&wordid="+words[index]["id"]
	 });
	 console.log("??");
	 refresh();
	},true);
//提交主评论
//$("#tjzpl").click(function(){
//	var type = "";
//	for(var i = 0;i<$("option").length;i++) {   
//		if ($("option")[i].selected==true)
//		     type=$("option")[i].value;
//	};
//	
//	console.log(type);
//	console.log(document.getElementById('plwbk').value);
//	
//	$.ajax({
//	 	type:"post",
//	 	url:"../addcomment",
//	 	async:true,
//	 	data:"content="+document.getElementById('plwbk').value+"&type="+type+"&wordname="+words[index]["word"]+"&wordid="+words[index]["id"]
//	 });
//	 console.log("??");
//	 refresh();
//	 refresh();
//	 
//})

    	
//$("#nex").click(function(){
//		    var wordshtml = "";
//
//				       index=(index+1)%words.length;
//  			 	    wordshtml = wordshtml + "<div class=\"media-body\"  word = "+words[index]+">";
//	  			 		wordshtml = wordshtml + "<h2 class=\"media-heading \">"+words[index]["word"]+"</h2>";
//	  			 		   wordshtml = wordshtml + "<div style = \""+wordstyle+"\">";
//  				 		wordshtml = wordshtml + "<p>  音标    : </br> "+words[index]["accent"]+"</p>";
//  				 		wordshtml = wordshtml + "<p>  词根    : </br> "+words[index]["word_etyma"]+"</p>";
//  				 		wordshtml = wordshtml + "<p>中文翻译  : </br> "+words[index]["mean_cn"]+"</p>";
//  				 		wordshtml = wordshtml + "<p>英文翻译  : </br> "+words[index]["mean_en"]+"</p>";
//  			 			wordshtml = wordshtml + "<p> 例句       : </br> "+words[index]["sentence"]+"</p>";
// 	 				 		wordshtml = wordshtml + "<p>例句翻译  : </br> "+words[index]["sentence_trans"]+"</p>";
//  				 		wordshtml = wordshtml + "</div>";
//  				 		 wordshtml = wordshtml + "</div>";
//  			 			
//  			 $("#words").html(wordshtml);
//});



    	

//  	<div class="media-body">
//                  <h2 class="media-heading ">Consectur Fusce Enim</h2>
//                  <p>
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.  
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  Phasellus dapibus nulla quis risus auctor, non placerat augue consectetur.
//                  </p>
//                </div>        
    	
    </script>